import bj from'./img/bj.jpg';
let all=document.querySelector('.all');
let li = document.querySelectorAll('li');
let con = document.querySelector('.content');
let a = con.querySelectorAll('a');
all.style['background-image']=`url(${bj})`;
li[0].classList.add('li-active');
li.forEach((e, i) => {
    e.addEventListener('click', () => {
        li.forEach((e, i1) => {
            if (i1 != i) e.classList.toggle('li-active', false);
        });
        for (let j = 0; j < con.children.length; j++) {
            if (j != i) con.children[j].style.opacity = '0';
        }
        con.children[i].style.opacity = '1'; //显示对应index
        e.classList.toggle('li-active', true);
    });
});
//显示最近统计的index
let a1 = document.createElement('a');
a1.href = a[a.length - 1].href;
a1.innerText = a[a.length - 1].innerText;
console.log(a1);
con.children[0].appendChild(a1);
